<%@ page contentType="text/html;charset=gb2312"%>
<!-- <%@ page import="com.sims.MySQLConnBean"%> -->
<jsp:useBean id="mySqlBean" scope="page" class="com.sims.MySQLConnBean" />
<%@ page import="java.sql.*"%>
<%
	String userAccount = (String) request.getParameter("userAccount");
	String userPassword = (String) request.getParameter("userPassword");
	boolean validated = false;
	if (userAccount != null || userAccount.trim().length() > 0) {
		//MySQLConnBean mySqlBean = new MySQLConnBean();
		mySqlBean.OpenConn(); //����MySqlBean�м���JDBC�����ķ���
		String strSql = "select user_account,user_password,user_name from stn_user where user_account='"
				+ userAccount + "'";
		ResultSet rs = mySqlBean.executeQuery(strSql);
		while (rs.next()) {
			if ((rs.getString("user_password").equals(userPassword))) {
				validated = true; //��ʶΪtrue��ʾ��֤�ɹ�ͨ��
				break;
			}
		}
		rs.close();
		mySqlBean.closeStmt();
		mySqlBean.closeConn();
	}
	if (validated) {
		//��֤�ɹ���ת��welcome.jsp
%>
<jsp:forward page="welcome.jsp" />
<%
	} else {
		//��֤ʧ����ת��error.jsp
%>
<jsp:forward page="error.jsp" />
<%
	}
%>
